
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>添加渠道</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/static/css/style.css">
    <link rel="icon" href="__PUBLIC__/static/image/code.png">
</head>
<body class="body">

<form class="layui-form" action="" method="post" id="addform">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">渠道名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入渠道名称" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">
            渠道ID
        </label>
        <div class="layui-input-inline">
            <input type="number" name="num" placeholder="渠道ID" class="layui-input"/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">联系人</label>
        <div class="layui-input-inline">
            <input type="text" name="contact" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input type="number" name="mobile" class="layui-input" min="1">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">emial</label>
        <div class="layui-input-inline">
            <input type="text" name="email" class="layui-input">
        </div>
    </div>    

    <div class="layui-form-item">
        <label class="layui-form-label">接口地址</label>
        <div class="layui-input-block">
            <input type="text" name="http" class="layui-input">
        </div>
    </div>  


<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   

            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamehost" placeholder="游戏数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="gameport" placeholder="游戏数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gameuser" placeholder="游戏数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamepass" placeholder="游戏数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    游戏数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="gamename" placeholder="游戏数据库名称" class="layui-input"/>
                </div>
            </div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   

            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="userhost" placeholder="用户数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="userport" placeholder="用户数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="useruser" placeholder="用户数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="userpass" placeholder="用户数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    用户数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="username" placeholder="用户数据库名称" class="layui-input"/>
                </div>
            </div>
</div>

<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">   

            <div class="layui-form-item">
                <label class="layui-form-label">
                    日志数据库主机
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="loghost" placeholder="数据库主机" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库端口
                </label>
                <div class="layui-input-inline">
                    <input type="number" name="logport" placeholder="数据库端口" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库用户
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="loguser" placeholder="数据库用户" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库密码
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="logpass" placeholder="数据库密码" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    数据库名称
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="logname" placeholder="数据库名称" class="layui-input"/>
                </div>
            </div>
</div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注描述</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入内容" name="remark" class="layui-textarea"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox" checked="" name="status" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<!-- 通用-970*90 -->
<script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
<script src="__ADMIN__/js/comm.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'upload', 'laydate'], function(){
        var form = layui.form
                ,layer = layui.layer
                ,$ = layui.$ //重点处

        //自定义验证规则
        form.verify({
            title: function(value){
                if(value.length < 2){
                    return '标题至少得2个字符啊';
                }
            }
        });

        //监听指定开关
      form.on('submit(demo1)', function(data) {
        $.post("{:url('admin/Platform/add')}", $('#addform').serialize(),
          function(data) {
            if (data.code == 1) {
              layer.alert(data.msg, {
                skin: 'layui-layer-molv' //样式类名
                  ,
                closeBtn: 0
              }, function() {
                location.href = data.url;
              });
            } else {
              layer.msg(data.msg);
            }
          });
        return false;
      });


    });
</script>
</body>
</html>